Socket
Socket
Sign inDemoInstall

@aws-sdk/middleware-header-default

Package Overview
Dependencies
2
Maintainers
4
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-header-default


Version published
Weekly downloads
248K
decreased by-20.83%
Maintainers
4
Created
Weekly downloads
 

Package description

What is @aws-sdk/middleware-header-default?

@aws-sdk/middleware-header-default is a middleware package for the AWS SDK for JavaScript. It allows you to set default headers for your AWS service requests, ensuring that certain headers are always included in your requests without having to manually add them each time.

What are @aws-sdk/middleware-header-default's main functionalities?

Setting Default Headers

This feature allows you to set default headers for all requests made with a specific AWS service client. In this example, a custom header 'x-custom-header' with the value 'my-custom-value' is added to all requests made with the S3 client.

const { HeaderDefaultMiddleware } = require('@aws-sdk/middleware-header-default');
const { S3Client } = require('@aws-sdk/client-s3');

const client = new S3Client({
  region: 'us-west-2',
  middlewareStack: (stack) => {
    stack.add(HeaderDefaultMiddleware({
      'x-custom-header': 'my-custom-value'
    }), {
      step: 'build',
      priority: 'high'
    });
  }
});

// Now all requests made with this client will include the 'x-custom-header' header.

Other packages similar to @aws-sdk/middleware-header-default

Readme

Source

@aws-sdk/middleware-header-default

NPM version NPM downloads

FAQs

Last updated on 30 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc